#! /usr/bin/env python
# -*- coding:utf-8 -*-
# author:无涯


import gevent
from gevent import monkey;monkey.patch_all()

def eat(name):
	print('{0} eat 1'.format(name))
	gevent.sleep(2)
	print('{0} eat 2'.format(name))


def play(name):
	print('{0} play 1'.format(name))
	gevent.sleep(1)
	print('{0} play 2'.format(name))


if __name__ == '__main__':
	g1 = gevent.spawn(eat, 'wuya')
	g2 = gevent.spawn(play, '无涯')
	gevent.joinall([g1, g2])